package IC.lir.instructions;
import IC.lir.*;
import java.util.List;

import IC.lir.operands.*;

import util.Pair;

/**
 * StaticCall _CLASS_METHOD ( arg=val, arg=val ), R1
 * 
 * Call method METHOD in class CLASS, return value in R1
 *
 */
public class StaticCallInstr extends CallInstr {
	private Label	methodLabel;

	/**
	 * Create a static call instruction
	 * @param className the class name of the call
	 * @param funcName the function name of the call
	 * @param args the arguments to the call
	 * @param dest
	 */
	public StaticCallInstr(Label methodLabel, 
			List<Pair<String, Operand>> args, RegOperand dest) {
		super(args,dest);
		this.methodLabel = methodLabel;
	}

	/**
	 * @return the funcName
	 */
	public Label getMethodLabel() {
		return methodLabel;
	}

	/**
	 * accept a visitor
	 */
	public <D, U> U accept(Visitor<D, U> v, D context) {
		return v.visit(this, context);
	}

}
